﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Configuration;

namespace ReferralTracker.BusinessObjects.Infrastructure {
    public static class ReferralTrackerApplication {

        private static IUnityContainer _container = null;

        static ReferralTrackerApplication() {
            var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");

            _container = new UnityContainer();
            section.Configure(_container, "default");
        }

        public static IUnityContainer Container {
            get {
                return _container;
            }
        }

        public static T Resolve<T>() where T : class {
            return _container.Resolve<T>();
        }
    }
}
